﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace App.CTL
{
    public partial class TxtB : UserControl
    {
        private List<string> m_Data = new List<string>();
        public TxtB()
        {
            InitializeComponent();
        }

        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        [Category("Appearance")]
        [Description("The text associated with the control.")]
        public override string Text
        {
            get
            {
                return txt1.Text;
            }
            set
            {  
                txt1.Text = value;
            }
        }

        public List<string> Data 
        { 
            get
            {
                return m_Data;
            }
            set
            {
                m_Data = value;
            }
        }

        private void btnT1_Click(object sender, EventArgs e)
        {
            TxtBForm frm = new TxtBForm();
            frm.Data = m_Data;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                txt1.Text = frm.SelectedItemString;
            }
        }
    }
}
